package com.guoxue.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IResourceDao;
import com.guoxue.domain.ResourceVo;
@Repository
public class ResourceDaoImpl extends BaseDaoImpl<ResourceVo> implements IResourceDao{

	@Override
	public void saveResource(ResourceVo rv) {
		saveOrUpdate(rv);
	}

	@Override
	public List<ResourceVo> getResourceList() {
		return find("FROM ResourceVo");
	}

	@Override
	public List<ResourceVo> getResourceByVersionCode(String versionCode) {
		return find("FROM ResourceVo r WHERE r.versionCode=? AND r.sysflag=0",new Object[] {versionCode});
	}

	@Override
	public ResourceVo getResourceByKey(Integer id) {
		return get("FROM ResourceVo r WHERE r.id=?  AND r.sysflag=0", new Object[]{id});
	}

}
